/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui.event.benhan;

import gui.benhan.PDT_Full;
import gui.benhan.PDTSua_Dialog;
import gui.benhan.PDTThem_Dialog;
import gui.event.khachhang.KHChiTietDlg_event;
import java.awt.print.PrinterException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JDialog;
import javax.swing.JTable;


import control.benhan.BAChiTiet_Dialog_Ctrl;
import model.entity.PhieuDieuTri;

/**
 *
 * @author Admin
 */
public class BAChiTietDlg_evt {
    
     public static final void btnInActionPerformed(JTable tbl) {
        try {
            tbl.print();
        } catch (PrinterException ex) {
            Logger.getLogger(BAChiTietDlg_evt.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
     
      public static final void btnCloseActionPerformed(JDialog dlg) {
        dlg.dispose();
    }
      public static final void btnThemActionPerformed(JTable table){
          PDTThem_Dialog pdtThemDlg = new PDTThem_Dialog(table, null, true);
          
          pdtThemDlg.setLocationRelativeTo(null);
          pdtThemDlg.setVisible(true);
      }
      
      public static final void btnSuaActionPerformed(JTable table){
	      PhieuDieuTri pdt = BAChiTiet_Dialog_Ctrl.selectRow(table);
          PDTSua_Dialog pdtSuaDlg = new PDTSua_Dialog(null, true);
		  pdtSuaDlg.getTxtMaPDT().setText(""+pdt.getPdtMa());
          pdtSuaDlg.getjDateChooserNgayTiem().setDate(pdt.getPdtNgayDieuTri());
          pdtSuaDlg.getjDateChooserNgayTiem1().setDate(pdt.getPdtNgayTaiKham());
          pdtSuaDlg.setLocationRelativeTo(null);
          pdtSuaDlg.setVisible(true);
      }
      
      public static final void btnChiTietActionPerformed(JTable table){
		  PhieuDieuTri pdt = BAChiTiet_Dialog_Ctrl.selectRow(table);
          PDT_Full pdtChiTietDlg = new PDT_Full(null, true);
		  pdtChiTietDlg.getTxtMaPhieuDieuTri().setText(""+pdt.getPdtMa());
          pdtChiTietDlg.getjDateChooserNgayTiem1().setDate(pdt.getPdtNgayDieuTri());
          pdtChiTietDlg.getjDateChooseNgaytaiKham().setDate(pdt.getPdtNgayTaiKham());
          pdtChiTietDlg.setLocationRelativeTo(null);
          pdtChiTietDlg.setVisible(true);
          
      }
      
}
